#define _CRT_SECURE_NO_WARNINGS 1
#include"Stack.h"

void StackInit(struct stack* ptr, int defaultcapacity)
{
	ptr->a = (int*)malloc(sizeof(int) * defaultcapacity);
	if (ptr == NULL)
	{
		perror("malloc fail");
		return;
	}
	ptr->top = 0;
	ptr->capacity = defaultcapacity;
}